/* Name:	Rio Atmadja
   Program: 	client.cpp
*/

#include "cardlinkedlist.h"
#include <iostream>
#include <string>
#include <sstream>
using namespace std;

int main() {

	CardLinkedList* list1 = new CardLinkedList();

	//insert cards to linked list
	for (int x =1;x<10;x++){
		string question = "this is test question ";
		string answer = "this is test answer ";
		stringstream q;
		q << question << x;
		stringstream a;
		a << answer << a;
		Card* testCard = new Card(q.str(),q.str());
		list1->insert(x,*testCard);
	}

	Card* currCard = new Card();//temp to store a card
	//retrieve and print cards from linked list
	for (int x=1;x<10;x++){
		list1->retrieve(x,*currCard);
		cout << " Test of Question " << x << ": " << currCard->showQuestion() << endl;
		cout << " Test of Answer " << x << ": " << currCard->showAnswer() << endl;

	}


	

}
